//
// Created by xuyang on 2018/6/7.
//



#include <unistd.h>
#include <stdio.h>        // for exit
#include "unistd.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

int main(){
    int fd;
    int fd2;
    fd=open("/Users/xuyang/workface/cpp/file_demo/a.txt",O_RDWR,0666);
    fd2=open("/Users/xuyang/workface/cpp/file_demo/a.txt",O_RDWR,0666);
    char s[] = "abc Linux Programmer!\n";
    int len=write(fd,s,sizeof(s)-1);
    len=write(fd,s,sizeof(s)-1);
    len=write(fd,s,sizeof(s)-1);
    len=write(fd,s,sizeof(s)-1);
    close(fd);
    return 0;
}